<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCruiseOrderModulesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cruise_order_input_types', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('orderId')->default(0)->comment('cruise_order.id');
            $table->string('inputType', 32)->default('')->comment('组件类型');
            $table->unsignedTinyInteger('templateType')->default(0)->comment('模板类型');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '巡检表单 - 通用表的组件';

            $table->index('orderId', 'idx_orderId');
            $table->index('inputType', 'idx_inputType');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cruise_order_input_types');
    }
}
